#pragma once

#include "../pattern/command.h"

#include <memory>
#include <vector>

// Basic execution class
class CExecute {
public:
	CExecute(ICommand execute, ICommand unexecute, const std::string& execinfo);
	virtual ~CExecute();

	virtual void Execute();
	virtual void Unexecute();

	std::string GetExecInfo() const;

private:
	ICommand m_Execute;
	ICommand m_Unexecute;
	const std::string m_Execinfo;
};

typedef std::shared_ptr<CExecute> CExecutePtr;


// Group execution.
class CExecuteGroup : public CExecute {
public:
	CExecuteGroup(const std::string& execinfo);
	virtual ~CExecuteGroup();

	void AddExecution(CExecutePtr orig);

	virtual void Execute();
	virtual void Unexecute();

private:
	std::vector<CExecutePtr> m_Execvec;
};
